/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hua YY
 * Date: 2025-01-09
 * Time: 10:46
 */
class Solution8 {
    public boolean isSubsequence(String s, String t) {
        int n1 = s.length() , n2 = t.length();
        if(n1 > n2) return false;
        int cur1 = 0 , cur2 = 0;
        while(cur1 < n1 && cur2 < n2){
            if(cur1 < n1 && cur2 < n2 && s.charAt(cur1) == t.charAt(cur2)){
                cur1++;
                cur2++;
            }else{
                cur2++;
            }
        }
        if(cur1 == n1 && cur2 <= n2){
            return true;
        }
        return false;
    }
}
public class Test8 {
}
